package com.polaris.live.widget.task

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.RelativeLayout
import com.bumptech.glide.Glide
import com.polaris.live.databinding.WidgetTaskNodeBinding
import com.polaris.live.resp.back_resp.UserProgressReward
import com.polaris.live.utils.image.ImageUtils

/**
 * TaskProgressView 主播任务带进度
 * @author Created by 天晴 on 2024/1/24 19:17
 * @since 1.0.0
 **/
class TaskNodeView(context: Context, attributeSet: AttributeSet?) :
    RelativeLayout(context, attributeSet) {

    private val mBinding = WidgetTaskNodeBinding.inflate(LayoutInflater.from(context), this)

    fun setData(item: UserProgressReward) {
        mBinding.apply {
            Glide.with(context)
                .load(ImageUtils.imgPath(item.icon))
                .into(img)
            tvNum.text = item.text
        }
    }
}